#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <cstdarg>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

int sum(int a ,...)
{
    va_list s;
    va_start(s,a);
    int ret = 0;
    while(a)
    {
        ret += va_arg(s,int);
    }
    va_end(s);
    return ret;
}


int main()
{

    std::cout << sum(1,2,3,4,5,6,7,8,9,10)<<std::endl;

    return 0;
}